package jndi.ldap.factory;

import jndi.ldap.biz.DefaultLdapOperator;
import jndi.ldap.LdapConnection;
import jndi.ldap.biz.LdapOperator;

/**
 * @author: Roy.Yang
 * Date: 1/20/12
 */
public class DefaultLdapOperatorBuilder implements LdapOperatorBuilder{
    private LdapConnection connection;
    private LdapOperator operator;
    public void createConnection() {
        this.connection = DefaultLdapConnectionManager.getInstance().openConnection();
    }

    public void createOperator() {
        this.operator = new DefaultLdapOperator();
    }

    public LdapOperator getLdapOperator() {
        operator.setConnection(this.connection);
        return this.operator;
    }
}
